home *** CD-ROM | disk | FTP | other *** search
- package sub_arctic.lib;
-
- import sub_arctic.output.drawable;
- import sub_arctic.output.loaded_image;
-
- import java.awt.Graphics;
-
- /**
- * Interactor which makes a row with a given background.
- *
- * @author Scott Hudson
- */
- public class backdrop_row extends row {
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Background pattern */
- protected loaded_image _pattern = null;
-
- /**
- * Get the background pattern.
- * @return loaded_image the pattern on this background.
- */
- public loaded_image pattern() {return _pattern;}
-
- /**
- * Set the Background pattern.
- * @param loaded_image pat the new pattern for this background.
- */
- public void set_pattern(loaded_image pat)
- {
- /* set pattern and cause redraw */
- if (_pattern != pat)
- {
- _pattern = pat;
- damage_self();
- }
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Full constructor. We assume you will set the size and position
- * with constraints or directly set the values.
- *
- * @param int brd number of pixels of border.
- * @param int ic the interchild spacing (in pixels).
- * @param boolean boxed true if you want a box around this object.
- * @param boolean sbc size by children (should the size of the object
- * be determined by its children).
- * @param byte lt the layout type (defined in row).
- * @param loaded_image pat the background pattern to use.
- */
- public backdrop_row(
- int brd, int ic,
- boolean boxed, boolean sbc, byte lt,
- loaded_image pat)
- {
- super(0,0,10,10,brd,ic,boxed,false,sbc,lt,null);
- set_pattern(pat);
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Draw the object.
- * @param drawable d the surface to draw on.
- */
- protected void draw_self_local(drawable d)
- {
- /* draw the backdrop then let the super class do the rest */
- if (pattern() != null)
- d.tileImage(pattern(), 0,0, w()-1, h()-1);
-
- super.draw_self_local(d);
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- }
-
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-